package com.shop.test;

import com.shop.beans.Address;
import com.shop.beans.Goodstype;
import com.shop.beans.Manager;
import com.shop.beans.User;
import com.shop.dao.AddressDao;
import com.shop.dao.GoodstypeDao;
import com.shop.dao.ManagerDao;
import com.shop.dao.UserDao;
import com.shop.dao.imp.AddressDaoImp01;
import com.shop.dao.imp.GoodstypeDaoImp01;
import com.shop.dao.imp.ManagerDaoImp01;
import com.shop.dao.imp.UserDaoImp01;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class test2imp {
    public static void main(String[] args) throws ParseException {
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        Date date=sdf.parse("2022-01-01");
        User user=new User(5,"16","password","realname","cardid",date,"15513756897","userinfo10001");
        Manager manager=new Manager(1,"admin","123456",1);
        Address address=new Address(4,3,"北京",036500,"xszx","15513756897");
        //System.out.println(user);
        UserDao userDao=new UserDaoImp01();
        //userDao.addUser(user);
        //userDao.updateUser(user);
        //userDao.deleteUser(5);
        //List<User> users= userDao.getUsers();
        //userDao.getUserById(4);
        ManagerDao managerDao=new ManagerDaoImp01();
        //managerDao.AddManager(manager);
        //managerDao.UpdateManager(manager);
        //managerDao.DeleteManager(2);
        //managerDao.GetManagers();
        //managerDao.GetManagerById(3);
        AddressDao addressDao=new AddressDaoImp01();
        //addressDao.addAddress(address);
        //addressDao.updateAddress(address);
        //addressDao.deleteAddress(4);
        //addressDao.getAddressById(3);
        //addressDao.getAddressesByUser(6);
        Goodstype goodstype1=new Goodstype(5,"挂件","挂件的简介",0);
        GoodstypeDao goodstypeDao=new GoodstypeDaoImp01();
        //goodstypeDao.addGoodstype(goodstype1);
        //goodstypeDao.getAllGoodstype();
        //goodstypeDao.getGoodstypeById(5);
        //goodstypeDao.getGoodstypeByParent(0);
        //goodstypeDao.updateGoodstype(goodstype1);
        //goodstypeDao.getGoodstypeById(5);


    }
}
